var a = getApp(), t = null;

Page({
    data: {
        searchValue: "",
        summary: "",
        title: "",
        texts: [],
        bannerguanggao: a.data.bannerguanggao,
        indexVideoAd: a.data.indexVideoAd,
        chapingguanggao: a.data.chapingguanggao,
        servsers: a.data.servsers,
        imagetpolk: "http://wq.qyyh.xyz/xcx/xcxtz/wm/timg.jpg"
    },
    onLoad: function() {
        var e = [];
        e.push("谁给我们生命的火焰↵你忍耐的人们的美丽↵只梦想自己的世界到末日"), e.push("我走进了你的幻梦的道儿↵她只有现实的人们的美丽↵这便是人类中的影子↵↵我初见在我的世界时↵黑纱在天空上飞↵夹杂地迸飞于天空的田间"), 
        this.setData({
            summary: "微信公众号为你服务",
            texts: e,
            title: "青衣雅会网络科技"
        }), wx.createInterstitialAd && a.data.chapinguanggao && ((t = wx.createInterstitialAd({
            adUnitId: 'adunit-bddd19766261df89'
        })).onLoad(function() {}), t.onError(function(a) {}), t.onClose(function() {})), 
        t && t.show().catch(function(a) {
            console.error(a);
        });
    },
    searchValueInput: function(a) {
        var t = a.detail.value;
        this.setData({
            searchValue: t
        });
    },
    suosearch: function(a) {
        var t = this;
        wx.login({
            success: function(a) {
                var e = a.code;
                console.log("code>>>" + e), t.suo(e);
            }
        });
    },
    suo: function(t) {
        var e = this;
        wx.chooseImage({
            count: 9,
            sizeType: [ "original", "compressed" ],
            sourceType: [ "album", "camera" ],
            success: function(o) {
                var s = o.tempFilePaths;
                wx.showLoading({
                    title: "正在处理.....",
                    mask: !0
                }), console.log("当前图片地址" + s[0]), wx.uploadFile({
                    url: a.data.servsers + "/app/rs/baiduyuyin/ai/demosigndouyinqq/" + a.data.platefroam + "/" + t + "/" + a.data.pid,
                    filePath: s[0],
                    name: "filePath",
                    success: function(a) {
                        var t = JSON.parse(a.data);
                        if (200 == t.code) {
                            var o = [];
                            t.data.forEach(function(a) {
                                o.push(a.poemContent);
                            }), e.setData({
                                summary: "微信公众号为你服务",
                                texts: o,
                                title: "青衣雅会网络科技",
                                imagetpolk: s[0]
                            }), console.log(t), wx.hideLoading();
                        } else wx.showModal({
                            title: "提示",
                            content: t.msg
                        });
                    },
                    fail: function(a) {
                        console.log(a), wx.showModal({
                            title: "提示",
                            content: "上传失败，请重试！"
                        }), wx.hideLoading();
                    }
                });
            }
        });
    },
    copyText: function(a) {
        wx.setClipboardData({
            data: a.currentTarget.dataset.text,
            success: function(a) {
                wx.getClipboardData({
                    success: function(a) {
                        wx.showToast({
                            title: "复制成功"
                        });
                    }
                });
            }
        });
    },
    copyAll: function(a) {
        var t = this.data.texts.join("");
        wx.setClipboardData({
            data: t,
            success: function(a) {
                wx.getClipboardData({
                    success: function(a) {
                        wx.showToast({
                            title: "复制成功"
                        });
                    }
                });
            }
        });
    }
});